Optimal. Leaf size=103 \[ \frac {a^2 (3 B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {2 a^2 (3 B+2 C) \tan (c+d x)}{3 d}+\frac {a^2 (3 B+2 C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {4139, 12, 3873,
3852, 8, 4131, 3855} \begin {gather*} \frac {2 a^2 (3 B+2 C) \tan (c+d x)}{3 d}+\frac {a^2 (3 B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {a^2 (3 B+2 C) \tan (c+d x) \sec (c+d x)}{6 d}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 12
Rule 3852
Rule 3855
Rule 3873
Rule 4131
Rule 4139
Rubi steps
\begin {align*} \int (a+a \sec (c+d x))^2 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {\int a (3 B+2 C) \sec (c+d x) (a+a \sec (c+d x))^2 \, dx}{3 a}\\ &=\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} (3 B+2 C) \int \sec (c+d x) (a+a \sec (c+d x))^2 \, dx\\ &=\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{3} (3 B+2 C) \int \sec (c+d x) \left (a^2+a^2 \sec ^2(c+d x)\right ) \, dx+\frac {1}{3} \left (2 a^2 (3 B+2 C)\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {a^2 (3 B+2 C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {1}{2} \left (a^2 (3 B+2 C)\right ) \int \sec (c+d x) \, dx-\frac {\left (2 a^2 (3 B+2 C)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 d}\\ &=\frac {a^2 (3 B+2 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {2 a^2 (3 B+2 C) \tan (c+d x)}{3 d}+\frac {a^2 (3 B+2 C) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.36, size = 63, normalized size = 0.61 \begin {gather*} \frac {a^2 \left ((9 B+6 C) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (12 (B+C)+3 (B+2 C) \sec (c+d x)+2 C \tan ^2(c+d x)\right )\right )}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.98, size = 145, normalized size = 1.41
method | result | size |
derivativedivides | \(\frac {a^{2} B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-a^{2} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+2 a^{2} B \tan \left (d x +c \right )+2 a^{2} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \tan \left (d x +c \right )}{d}\) | \(145\) |
default | \(\frac {a^{2} B \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-a^{2} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+2 a^{2} B \tan \left (d x +c \right )+2 a^{2} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \tan \left (d x +c \right )}{d}\) | \(145\) |
norman | \(\frac {\frac {8 a^{2} \left (3 B +2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {a^{2} \left (3 B +2 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{2} \left (5 B +6 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a^{2} \left (3 B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{2} \left (3 B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(149\) |
risch | \(-\frac {i a^{2} \left (3 B \,{\mathrm e}^{5 i \left (d x +c \right )}+6 C \,{\mathrm e}^{5 i \left (d x +c \right )}-12 B \,{\mathrm e}^{4 i \left (d x +c \right )}-6 C \,{\mathrm e}^{4 i \left (d x +c \right )}-24 B \,{\mathrm e}^{2 i \left (d x +c \right )}-24 C \,{\mathrm e}^{2 i \left (d x +c \right )}-3 B \,{\mathrm e}^{i \left (d x +c \right )}-6 C \,{\mathrm e}^{i \left (d x +c \right )}-12 B -10 C \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(214\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 167, normalized size = 1.62 \begin {gather*} \frac {4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{2} - 3 \, B a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, C a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, B a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 24 \, B a^{2} \tan \left (d x + c\right ) + 12 \, C a^{2} \tan \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.75, size = 125, normalized size = 1.21 \begin {gather*} \frac {3 \, {\left (3 \, B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (3 \, B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, {\left (6 \, B + 5 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) + 2 \, C a^{2}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int B \sec {\left (c + d x \right )}\, dx + \int 2 B \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{4}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 178, normalized size = 1.73 \begin {gather*} \frac {3 \, {\left (3 \, B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (3 \, B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (9 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.72, size = 145, normalized size = 1.41 \begin {gather*} \frac {2\,a^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,B}{2}+C\right )}{d}-\frac {\left (3\,B\,a^2+2\,C\,a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-8\,B\,a^2-\frac {16\,C\,a^2}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (5\,B\,a^2+6\,C\,a^2\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________